package edu.cmu.cs.stage3.alice.authoringtool.viewcontroller;

import edu.cmu.cs.stage3.alice.authoringtool.AuthoringToolResources;

/**
 * @author Jason Pratt
 */
public class DefaultPropertyViewController extends PropertyViewController {
	protected javax.swing.JLabel label = new javax.swing.JLabel();

	//Rem @Override
	public void set( edu.cmu.cs.stage3.alice.core.Property property, boolean includeDefaults, boolean allowExpressions, boolean includeOther, boolean omitPropertyName, final edu.cmu.cs.stage3.alice.authoringtool.util.PopupItemFactory factory ) {
		super.set( property, includeDefaults, allowExpressions, includeOther, omitPropertyName, factory );
		setPopupEnabled( true );
		refreshGUI();
	}

	//Rem @Override
	protected java.awt.Component getNativeComponent() {
		return label;
	}

	//Rem @Override
	protected Class getNativeClass() {
		return Object.class;
	}

	//Rem @Override
	protected void updateNativeComponent() {
		label.setText( AuthoringToolResources.getReprForValue( property.get(), property ) );
	}
}
